package com.punch.course.controller;

import com.punch.common.model.Result;
import com.punch.common.vo.system.category.CategoryTreeVO;
import com.punch.course.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * CategroyController-
 *
 * @author wujj
 * @version 1.0.0
 * @since 2020/7/24 15:25
 */
@RestController
@Api(value = "CourseCategroyController", tags = "课程类目Controller")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 类目树形
     *
     * @return List<TreeAreaVO>
     * @author wujj
     * @since 2020/6/4 19:16
     */
    @GetMapping(value = "/category/tree", produces = "application/json; charset=utf-8")
    @ApiOperation(value = "类目树形", notes = "类目树形", produces = "application/json")
    public Result<List<CategoryTreeVO>> treeCategory() {
        return Result.succeed(categoryService.treeCategory());
    }


}
